#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 1e5;
const int M = 1e9 + 7;

int t, n;
ll a;
int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);

    cin >> t;
    while (t--)
    {
        cin >> n;
        ll sum = 0, maxi = -1e18;

        for (int i = 1; i <= n; i++) {
            cin >> a;
            sum += a;
            maxi = max(maxi, a);
        }

    
        double res = (sum-maxi) * 1.0 / (n - 1) + maxi;
        printf("%.6lf\n", res);
    }
    return 0;
}